package advance

import (
	"context"
	"fmt"

	"go.mongodb.org/mongo-driver/bson"
	"go.mongodb.org/mongo-driver/mongo"
)

// 查询int32的值，且去除重复的值，但不像mysql的count(*)，那样能把所有字段的值查出来
func Distinct(mongo *mongo.Database, ctx context.Context) {
	num, err := mongo.Collection("test").Distinct(ctx, "int32", bson.M{})
	fmt.Println(err)
	fmt.Println(num)
}
